// Armisael.cpp : Defines the entry point for the console application.
//

// OpenCV_Helloworld.cpp : Defines the entry point for the console application.
// Created for build/install tutorial, Microsoft Visual C++ 2010 Express and OpenCV 2.1.0

#include "stdafx.h"

#include <iostream>
#include "aruco.h"
#include "cvdrawingutils.h"
using namespace cv;
using namespace aruco;
/************************************
 *
 *
 *
 *
 ************************************/
int main(int argc,char **argv)
{

	aruco::cameraparameters CamParam;
		MarkerDetector MDetector;
		vector<marker> Markers;
		float MarkerSize=-1;
		cv::Mat InImage=cv::imread("image-test.png");

		// IplImage *img = cvLoadImage("image-test.png");

		//cv::Mat InImage = cv::imread("image-test.png");

		// CamParam.readFromXMLFile("intrinsics.yml");
		// MarkerSize=0.05;

		
		// cvNamedWindow("Image:",1);

		//MDetector.detect(InImage,Markers,CamParam,MarkerSize);


		 cvWaitKey(0);
		exit(0);
	
		/*
		try
	{
		if(argc<3) {cerr<<"Usage: in.jpg [cameraParams.yml] [markerSize] [outImage]"<<endl;exit(0);}
		aruco::cameraparameters CamParam;
		MarkerDetector MDetector;
		vector<marker> Markers;
		float MarkerSize=-1;
		cv::Mat InImage=cv::imread(argv[1]);
		if (argc>=3) CamParam.readFromXMLFile(argv[2]);
		//resizes the parameters to fit the size of the input image
		CamParam.resize( InImage.size());
		
		if (argc>=4) MarkerSize=atof(argv[3]);
		cv::namedWindow("NOZZLE",1);
		MDetector.detect(InImage,Markers,CamParam,MarkerSize);
		//for each marker, draw info and its boundaries in the image
		for(unsigned int i=0;i<Markers.size();i++){
			cout<<Markers[i]<<endl;
			Markers[i].draw(InImage,Scalar(0,0,255),2);
		}

		//draw a 3d cube in each marker if there is 3d info
		if (  CamParam.isValid())
		  for(unsigned int i=0;i<Markers.size();i++){
		    CvDrawingUtils::draw3dCube(InImage,Markers[i],CamParam);
		  }
		//show input with augmented information
		cv::imshow("in.jpg",InImage);
		cv::waitKey(0);//wait for key to be pressed
		if(argc>=5) cv::imwrite(argv[4],InImage);
	}catch(std::exception &ex)

	{
		cout<<"Exception :"<<ex.what()<<endl;
	}

	*/
}